﻿using System;

namespace 多态
{
    class Program
    {
        static void Main(string[] args)
        {
            //peosonrr[] pers = new peosonrr[8];
            //Chinese cn1 = new Chinese("韩梅梅");
            //Chinese cn2 = new Chinese("李雷");
            //Japanese j1 = new Japanese("树下君");
            //Japanese j2 = new Japanese("井边子");
            //Korea k1 = new Korea("金久贤");
            //Korea k2 = new Korea("都敏俊");
            //American a1 = new American("科比布莱恩特");
            //American a2 = new American("奥尼尔");
            //peosonrr[] pers= { cn1, cn2, j1, j2, k1, k2, a1, a2 };
            //for (int i = 0; i < pers.Length; i++)
            //{
            //   if(pers[i]is Chinese)
            //    {
            //        ((Chinese)pers[i]).SayHello();
            //    }
            //   else if(pers[i]is Japanese)
            //    {
            //        ((Japanese)pers[i]).SayHello();
            //    }
            //   else if (pers[i]is Korea)
            //    {
            //        ((Korea)pers[i]).SayHello();
            //    }
            //    else
            //    {
            //        ((American)pers[i]).SayHello();
            //    }
            // pers[i].SayHello();
            //}

            //真鸭子嘎嘎叫 木头鸭子吱吱叫 橡皮鸭子卡卡叫
            Zhen zd = new Zhen();
            Mu md = new Mu();
            Xiang xd = new Xiang();
            Zhen[] durse = { zd, md, xd };
            for (int i = 0; i < durse.Length; i++)
            {
                durse[i].baye();
            }
            Console.ReadKey();

        }
    }
}
